package com.iscale.model.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.toolkit.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.io.Serializable;


/**
 * <p>
 * 需求类别
 * </p>
 *
 * @author Andychen
 * @since 2017-03-10
 */
@TableName("base_needs_info")
@SuppressWarnings("serial")
@JsonIgnoreProperties(ignoreUnknown = true)
public class BaseNeedsInfo extends Model<BaseNeedsInfo> {

    private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.ID_WORKER)//分布式全局唯一 IdType.ID_WORKER
	private Long id;
    /**
     * 品类名称
     */
	private String name;

	@TableField("merchantNo")
	private String merchantNo;
    /**
     * 父id
     */
	private Long pid;
    /**
     * 类别 0-系统品类 1-自定义品类
     */
	private Integer ptype;
    /**
     * 品类图片
     */
	@TableField("iconFile")
	private Long iconFile;
    /**
     * 品类图片url
     */
	@TableField("iconUrl")
	private String iconUrl;
	@TableField("createTime")
	private Date createTime;
	@TableField("updateTime")
	private Date updateTime;
	@TableField("createUser")
	private String createUser;
	@TableField("updateUser")
	private String updateUser;
    /**
     * 排序
     */
	private Long rank;
    /**
     * 状态 0-有效 1-无效
     */
	private Integer status;
    /**
     * 是否可删除 0-可删除 1-不可删除
     */
	@TableField("isFinal")
	private Integer isFinal;


	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMerchantNo() {
		return merchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		this.merchantNo = merchantNo;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public Integer getPtype() {
		return ptype;
	}

	public void setPtype(Integer ptype) {
		this.ptype = ptype;
	}

	public Long getIconFile() {
		return iconFile;
	}

	public void setIconFile(Long iconFile) {
		this.iconFile = iconFile;
	}

	public String getIconUrl() {
		return iconUrl;
	}

	public void setIconUrl(String iconUrl) {
		this.iconUrl = iconUrl;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	public Long getRank() {
		return rank;
	}

	public void setRank(Long rank) {
		this.rank = rank;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getIsFinal() {
		return isFinal;
	}

	public void setIsFinal(Integer isFinal) {
		this.isFinal = isFinal;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	public BaseNeedsInfo(){}

	public BaseNeedsInfo(Long id, String name, String merchantNo, Long pid, Long iconFile, String iconUrl, String createUser, String updateUser, Integer status, Integer isFinal) {
		this.name = name;
		this.merchantNo = merchantNo;
		this.pid = pid;
		this.iconFile = iconFile;
		this.iconUrl = iconUrl;
		this.createUser = createUser;
		this.updateUser = updateUser;
		this.status = status;
		if(StringUtils.isEmpty(merchantNo)){
			this.ptype = 0;
		}else{
			this.ptype=1;
		}
		this.isFinal = isFinal;
	}

	public BaseNeedsInfo(String name, String merchantNo, Long pid, Long iconFile, String iconUrl, String createUser, String updateUser, Integer status, Integer isFinal) {
		this(0l, name,  merchantNo,  pid,iconFile, iconUrl, createUser,  updateUser,  status,  isFinal);
	}

	public BaseNeedsInfo(String name, String merchantNo, Long pid, String createUser, String updateUser, Integer status, Integer isFinal) {
		this(name,  merchantNo,  pid,null, null, createUser,  updateUser,  status,  isFinal);
	}
}
